Fix VirtualThread support on multiple unmount/remount cycles #10931
Fix VirtualThread support on multiple unmount/remount cycles #10931gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intomasterfrom
Conversation
| spanIdsAfterRemount[remount] = GlobalTracer.get().getSpanId(); | ||
| } | ||
| }); | ||
| try { |
There was a problem hiding this comment.
Why does the method throws InterruptedException,
when in the body it catches and wraps InterruptedException in a RuntimeException
There was a problem hiding this comment.
Ahah, no, that was not AI generated. I took it from the original reproducer: https://github.com/DataDog/dd-trace-java/pull/10887/changes#diff-7981a7fa278247a76ac7f99feef1b2ae6fd4dc3dabd694140324fbb22083ea1dR145 but I clearly forgot to clean it up.
And as I duplicated the test cases, it propagated along all test methods. I will clean it up, thanks for catching it!
dougqh
left a comment
There was a problem hiding this comment.
Overall, the change looks good to me.
The handling of InterruptedException-s in the test seems like it could be cleaned up. The test methods are both throwing InterruptedException, but also catching InterruptedException and wrapping in RuntimeException.
I would expect them to do one or the other but not both. Admittedly, I didn't read the tests carefully, so ultimately, I'll leave it to your judgment.
The part where I'm not confident is the use of |
03f4969 to
96eda42
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
|
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 59 metrics, 12 unstable metrics. Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~96eda42a2f, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.055 s) : 0, 1055079
Total [baseline] (8.87 s) : 0, 8870002
Agent [candidate] (1.055 s) : 0, 1055487
Total [candidate] (8.835 s) : 0, 8834856
section iast
Agent [baseline] (1.238 s) : 0, 1238395
Total [baseline] (9.551 s) : 0, 9551311
Agent [candidate] (1.239 s) : 0, 1239288
Total [candidate] (9.577 s) : 0, 9576532
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~96eda42a2f, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.197 ms) : 0, 1197
crashtracking [candidate] (1.188 ms) : 0, 1188
BytebuddyAgent [baseline] (628.473 ms) : 0, 628473
BytebuddyAgent [candidate] (627.944 ms) : 0, 627944
AgentMeter [baseline] (29.371 ms) : 0, 29371
AgentMeter [candidate] (29.395 ms) : 0, 29395
GlobalTracer [baseline] (256.542 ms) : 0, 256542
GlobalTracer [candidate] (256.746 ms) : 0, 256746
AppSec [baseline] (31.735 ms) : 0, 31735
AppSec [candidate] (31.749 ms) : 0, 31749
Debugger [baseline] (59.634 ms) : 0, 59634
Debugger [candidate] (59.559 ms) : 0, 59559
Remote Config [baseline] (592.423 µs) : 0, 592
Remote Config [candidate] (583.141 µs) : 0, 583
Telemetry [baseline] (8.002 ms) : 0, 8002
Telemetry [candidate] (8.791 ms) : 0, 8791
Flare Poller [baseline] (3.492 ms) : 0, 3492
Flare Poller [candidate] (3.559 ms) : 0, 3559
section iast
crashtracking [baseline] (1.213 ms) : 0, 1213
crashtracking [candidate] (1.199 ms) : 0, 1199
BytebuddyAgent [baseline] (807.814 ms) : 0, 807814
BytebuddyAgent [candidate] (805.366 ms) : 0, 805366
AgentMeter [baseline] (11.874 ms) : 0, 11874
AgentMeter [candidate] (11.917 ms) : 0, 11917
GlobalTracer [baseline] (247.227 ms) : 0, 247227
GlobalTracer [candidate] (248.774 ms) : 0, 248774
IAST [baseline] (25.248 ms) : 0, 25248
IAST [candidate] (25.698 ms) : 0, 25698
AppSec [baseline] (27.09 ms) : 0, 27090
AppSec [candidate] (27.679 ms) : 0, 27679
Debugger [baseline] (66.627 ms) : 0, 66627
Debugger [candidate] (67.255 ms) : 0, 67255
Remote Config [baseline] (516.86 µs) : 0, 517
Remote Config [candidate] (524.333 µs) : 0, 524
Telemetry [baseline] (11.038 ms) : 0, 11038
Telemetry [candidate] (10.866 ms) : 0, 10866
Flare Poller [baseline] (3.399 ms) : 0, 3399
Flare Poller [candidate] (3.694 ms) : 0, 3694
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~96eda42a2f, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1057493
Total [baseline] (11.096 s) : 0, 11096458
Agent [candidate] (1.059 s) : 0, 1059363
Total [candidate] (10.988 s) : 0, 10988140
section appsec
Agent [baseline] (1.249 s) : 0, 1248554
Total [baseline] (11.185 s) : 0, 11184919
Agent [candidate] (1.246 s) : 0, 1246454
Total [candidate] (11.16 s) : 0, 11159652
section iast
Agent [baseline] (1.231 s) : 0, 1230632
Total [baseline] (11.37 s) : 0, 11369813
Agent [candidate] (1.235 s) : 0, 1234996
Total [candidate] (11.338 s) : 0, 11338163
section profiling
Agent [baseline] (1.182 s) : 0, 1181652
Total [baseline] (10.929 s) : 0, 10928996
Agent [candidate] (1.188 s) : 0, 1188227
Total [candidate] (11.098 s) : 0, 11098298
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~96eda42a2f, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.19 ms) : 0, 1190
crashtracking [candidate] (1.203 ms) : 0, 1203
BytebuddyAgent [baseline] (628.796 ms) : 0, 628796
BytebuddyAgent [candidate] (631.894 ms) : 0, 631894
AgentMeter [baseline] (29.375 ms) : 0, 29375
AgentMeter [candidate] (29.176 ms) : 0, 29176
GlobalTracer [baseline] (256.555 ms) : 0, 256555
GlobalTracer [candidate] (256.431 ms) : 0, 256431
AppSec [baseline] (31.769 ms) : 0, 31769
AppSec [candidate] (31.577 ms) : 0, 31577
Debugger [baseline] (60.174 ms) : 0, 60174
Debugger [candidate] (60.216 ms) : 0, 60216
Remote Config [baseline] (594.099 µs) : 0, 594
Remote Config [candidate] (600.609 µs) : 0, 601
Telemetry [baseline] (8.678 ms) : 0, 8678
Telemetry [candidate] (7.987 ms) : 0, 7987
Flare Poller [baseline] (4.307 ms) : 0, 4307
Flare Poller [candidate] (4.282 ms) : 0, 4282
section appsec
crashtracking [baseline] (1.187 ms) : 0, 1187
crashtracking [candidate] (1.184 ms) : 0, 1184
BytebuddyAgent [baseline] (660.272 ms) : 0, 660272
BytebuddyAgent [candidate] (658.818 ms) : 0, 658818
AgentMeter [baseline] (12.108 ms) : 0, 12108
AgentMeter [candidate] (12.082 ms) : 0, 12082
GlobalTracer [baseline] (258.115 ms) : 0, 258115
GlobalTracer [candidate] (257.838 ms) : 0, 257838
AppSec [baseline] (177.756 ms) : 0, 177756
AppSec [candidate] (177.964 ms) : 0, 177964
Debugger [baseline] (66.07 ms) : 0, 66070
Debugger [candidate] (65.649 ms) : 0, 65649
Remote Config [baseline] (628.089 µs) : 0, 628
Remote Config [candidate] (633.949 µs) : 0, 634
Telemetry [baseline] (8.414 ms) : 0, 8414
Telemetry [candidate] (8.327 ms) : 0, 8327
Flare Poller [baseline] (3.541 ms) : 0, 3541
Flare Poller [candidate] (3.587 ms) : 0, 3587
IAST [baseline] (24.236 ms) : 0, 24236
IAST [candidate] (24.186 ms) : 0, 24186
section iast
crashtracking [baseline] (1.184 ms) : 0, 1184
crashtracking [candidate] (1.191 ms) : 0, 1191
BytebuddyAgent [baseline] (797.609 ms) : 0, 797609
BytebuddyAgent [candidate] (801.264 ms) : 0, 801264
AgentMeter [baseline] (11.397 ms) : 0, 11397
AgentMeter [candidate] (11.512 ms) : 0, 11512
GlobalTracer [baseline] (247.967 ms) : 0, 247967
GlobalTracer [candidate] (249.305 ms) : 0, 249305
AppSec [baseline] (26.867 ms) : 0, 26867
AppSec [candidate] (27.495 ms) : 0, 27495
Debugger [baseline] (70.144 ms) : 0, 70144
Debugger [candidate] (69.658 ms) : 0, 69658
Remote Config [baseline] (528.311 µs) : 0, 528
Remote Config [candidate] (532.613 µs) : 0, 533
Telemetry [baseline] (9.68 ms) : 0, 9680
Telemetry [candidate] (9.119 ms) : 0, 9119
Flare Poller [baseline] (3.651 ms) : 0, 3651
Flare Poller [candidate] (3.317 ms) : 0, 3317
IAST [baseline] (25.591 ms) : 0, 25591
IAST [candidate] (25.492 ms) : 0, 25492
section profiling
ProfilingAgent [baseline] (93.43 ms) : 0, 93430
ProfilingAgent [candidate] (94.552 ms) : 0, 94552
crashtracking [baseline] (1.163 ms) : 0, 1163
crashtracking [candidate] (1.172 ms) : 0, 1172
BytebuddyAgent [baseline] (682.414 ms) : 0, 682414
BytebuddyAgent [candidate] (685.454 ms) : 0, 685454
AgentMeter [baseline] (9.043 ms) : 0, 9043
AgentMeter [candidate] (9.061 ms) : 0, 9061
GlobalTracer [baseline] (214.858 ms) : 0, 214858
GlobalTracer [candidate] (216.623 ms) : 0, 216623
AppSec [baseline] (32.263 ms) : 0, 32263
AppSec [candidate] (32.288 ms) : 0, 32288
Debugger [baseline] (65.945 ms) : 0, 65945
Debugger [candidate] (65.292 ms) : 0, 65292
Remote Config [baseline] (561.581 µs) : 0, 562
Remote Config [candidate] (568.005 µs) : 0, 568
Telemetry [baseline] (7.695 ms) : 0, 7695
Telemetry [candidate] (8.563 ms) : 0, 8563
Flare Poller [baseline] (3.446 ms) : 0, 3446
Flare Poller [candidate] (3.495 ms) : 0, 3495
Profiling [baseline] (93.979 ms) : 0, 93979
Profiling [candidate] (95.12 ms) : 0, 95120
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 16 metrics, 18 unstable metrics.
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~96eda42a2f, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section baseline
no_agent (1.198 ms) : 1186, 1209
. : milestone, 1198,
iast (3.268 ms) : 3221, 3316
. : milestone, 3268,
iast_FULL (6.016 ms) : 5955, 6077
. : milestone, 6016,
iast_GLOBAL (3.671 ms) : 3605, 3736
. : milestone, 3671,
profiling (2.24 ms) : 2218, 2262
. : milestone, 2240,
tracing (1.769 ms) : 1754, 1784
. : milestone, 1769,
section candidate
no_agent (1.163 ms) : 1152, 1174
. : milestone, 1163,
iast (3.138 ms) : 3101, 3176
. : milestone, 3138,
iast_FULL (5.827 ms) : 5769, 5885
. : milestone, 5827,
iast_GLOBAL (3.509 ms) : 3456, 3561
. : milestone, 3509,
profiling (2.085 ms) : 2066, 2104
. : milestone, 2085,
tracing (1.8 ms) : 1784, 1816
. : milestone, 1800,
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~96eda42a2f, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section baseline
no_agent (17.917 ms) : 17734, 18100
. : milestone, 17917,
appsec (18.583 ms) : 18394, 18772
. : milestone, 18583,
code_origins (17.629 ms) : 17457, 17802
. : milestone, 17629,
iast (18.798 ms) : 18609, 18988
. : milestone, 18798,
profiling (18.504 ms) : 18320, 18688
. : milestone, 18504,
tracing (17.662 ms) : 17485, 17840
. : milestone, 17662,
section candidate
no_agent (19.028 ms) : 18835, 19220
. : milestone, 19028,
appsec (18.613 ms) : 18427, 18800
. : milestone, 18613,
code_origins (17.608 ms) : 17435, 17781
. : milestone, 17608,
iast (17.603 ms) : 17429, 17777
. : milestone, 17603,
profiling (18.801 ms) : 18614, 18987
. : milestone, 18801,
tracing (18.01 ms) : 17832, 18187
. : milestone, 18010,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~96eda42a2f, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section baseline
no_agent (1.471 ms) : 1460, 1483
. : milestone, 1471,
appsec (2.528 ms) : 2473, 2584
. : milestone, 2528,
iast (2.253 ms) : 2184, 2321
. : milestone, 2253,
iast_GLOBAL (2.295 ms) : 2225, 2365
. : milestone, 2295,
profiling (2.094 ms) : 2039, 2150
. : milestone, 2094,
tracing (2.064 ms) : 2010, 2118
. : milestone, 2064,
section candidate
no_agent (1.471 ms) : 1460, 1483
. : milestone, 1471,
appsec (2.574 ms) : 2516, 2632
. : milestone, 2574,
iast (2.258 ms) : 2189, 2327
. : milestone, 2258,
iast_GLOBAL (2.294 ms) : 2224, 2364
. : milestone, 2294,
profiling (2.079 ms) : 2024, 2134
. : milestone, 2079,
tracing (2.066 ms) : 2012, 2120
. : milestone, 2066,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~96eda42a2f, baseline=1.61.0-SNAPSHOT~517a89d1ec3
dateFormat X
axisFormat %s
section baseline
no_agent (14.95 s) : 14950000, 14950000
. : milestone, 14950000,
appsec (14.693 s) : 14693000, 14693000
. : milestone, 14693000,
iast (18.365 s) : 18365000, 18365000
. : milestone, 18365000,
iast_GLOBAL (17.543 s) : 17543000, 17543000
. : milestone, 17543000,
profiling (15.05 s) : 15050000, 15050000
. : milestone, 15050000,
tracing (14.795 s) : 14795000, 14795000
. : milestone, 14795000,
section candidate
no_agent (15.425 s) : 15425000, 15425000
. : milestone, 15425000,
appsec (14.406 s) : 14406000, 14406000
. : milestone, 14406000,
iast (18.452 s) : 18452000, 18452000
. : milestone, 18452000,
iast_GLOBAL (17.525 s) : 17525000, 17525000
. : milestone, 17525000,
profiling (14.953 s) : 14953000, 14953000
. : milestone, 14953000,
tracing (14.784 s) : 14784000, 14784000
. : milestone, 14784000,
|
What Does This Do
This PR supersedes #10887 to fix context tracking on multiple virtual thread unmount / remount cycles.
Motivation
Previously, only one mount was supported, leading to context break.
Additional Notes
This PR is a re-implementation and adds the following changes compared to the original PR report:
afterTerminate/afterDonehooksContextScopeto reduce unnecessary type castsContributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.